From ad76679c04995f0d4f20b2a8a7fc09d243ffeeb4 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 3 May 2002 20:43:53 +0000 Subject: [PATCH] (eshell-modify-global-environment): Added this customization variable, which will cause any "export" commands within any eshell buffer to modify the global Emacs environment. It defaults to nil, which means that such commands will only modify that Eshell buffer's environment. (eshell-var-initialize): Initialize `eshell-modify-global-environment'. --- lisp/eshell/esh-var.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index e47ba5e0809..f447bfb0339 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -137,6 +137,11 @@ variable value, a subcommand, or even the result of a Lisp form." :type 'boolean :group 'eshell-var) +(defcustom eshell-modify-global-environment nil + "*If non-nil, using `export' changes Emacs's global environment." + :type 'boolean + :group 'eshell-var) + (defcustom eshell-variable-name-regexp "[A-Za-z0-9_-]+" "*A regexp identifying what constitutes a variable name reference. Note that this only applies for '$NAME'. If the syntax '$' is @@ -199,7 +204,9 @@ function), and the arguments passed to this function would be the list "Initialize the variable handle code." ;; Break the association with our parent's environment. Otherwise, ;; changing a variable will affect all of Emacs. - (set (make-local-variable 'process-environment) (eshell-copy-environment)) + (unless eshell-modify-global-environment + (set (make-local-variable 'process-environment) + (eshell-copy-environment))) (define-key eshell-command-map [(meta ?v)] 'eshell-insert-envvar) -- 2.30.2